<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <!-- 
    flex-wrap: nowrap(默认)，当item总宽度大于容器宽度，则item宽度会被等分，容器不会换行
               wrap , 当item总宽度大于容器宽度，item会根据自身宽度排列换行,
                      以Z字形排列换行
               wrap-reverse, 反转wrap
   -->
   <style>
     .nowrap{
       display: flex;
       width: 300px;
       height: 100px;
       border: 1px solid;
     }
     .nowrap div{
       width: 150px;
       background-color: #ccc;
       border: 1px solid;
     }
   </style>
   <h2>flex-wrap:nowrap</h2>
   <div class="nowrap">
     <div>1</div>
     <div>2</div>
     <div>3</div>
   </div>



   

   <!-- wrap , 当item总宽度大于容器宽度，item会根据自身宽度排列换行,以Z字形排列换行 -->
   <style>
     .wrap{
       display: flex;
       width: 300px;
       border: 1px solid;
       flex-wrap: wrap;
     }
     .wrap div{
       width: 100px;
       height: 100px;
       background-color: #ccc;
       border: 1px solid;
     }
   </style>
   <h2>flex-wrap:wrap</h2>
   <div class="wrap">
     <div>1</div>
     <div>2</div>
     <div>3</div>
   </div>




<!-- wrap-reverse, 反转wrap -->
   <style>
     .wrap-reverse{
       display: flex;
       width: 300px;
       border: 1px solid;
       flex-wrap: wrap-reverse;
       align-items: flex-start;
     }
     .wrap-reverse div{
       width: 100px;
       height: 100px;
       background-color: #ccc;
       border: 1px solid;
     }
   </style>
   <h2>flex-wrap:wrap-reverse</h2>
   <div class="wrap-reverse">
     <div>1</div>
     <div>2</div>
     <div>3</div>
   </div>
</body>
</html>